Converted these images to PNG, saving a handful of bytes per image
[adiumx.git] / Utilities / Log Importers / fire2adium.php
blob3bc0c7d6ce0c07e225ddf9fe94f1dcaa7c368cf1
1 <?
2 // from the command line:
3 // php -q fire2adium.php
5 // set this one variable
6 $system_username = "";
8 // you could set these too
9 $chat_username = "Fire Import";
10 $chat_service = "AIM";
12 // shouldn't need to set anything below
13 $fire_base = "/Users/${system_username}/Library/Application Support/Fire/Sessions";
14 $adium_base = "/Users/${system_username}/Library/Application Support/Adium 2.0/Users/Default/Logs/${chat_service}.${chat_username}";
16 if(!is_dir($adium_base))
17 mkdir($adium_base, 0755);
19 $fire_log_dirs = array();
20 $handle = opendir($fire_base);
21 while($file = readdir($handle))
23 if($file != "." && $file != ".." && is_dir("${fire_base}/${file}"))
24 $fire_log_dirs[] = $file;
27 foreach($fire_log_dirs as $fire_log_dir)
29 list($chat_username_receiver,$chat_service_receiver) = explode('-', $fire_log_dir);
30 $adium_log_dir = "$chat_username_receiver";
31 mkdir("${adium_base}/${adium_log_dir}", 0755);
33 $fire_logs = array();
34 $handle = opendir("${fire_base}/${fire_log_dir}");
35 while($file = readdir($handle))
37 if($file != "." && $file != ".." && !is_dir("${fire_log_path}/${fire_log_dir}/${file}"))
38 $fire_logs[] = $file;
41 foreach($fire_logs as $fire_log)
43 list($date, $crap) = explode(',', $fire_log);
44 list($year,$month,$day) = explode('-', $date);
45 copy("${fire_base}/${fire_log_dir}/${fire_log}", "${adium_base}/${adium_log_dir}/${chat_username_receiver} (${year}|${month}|${day}).html");
49 echo "done\n";